package job;

import com.coraframework.quartz.Job;
import com.coraframework.quartz.JobExecutionContext;
import com.coraframework.quartz.JobExecutionException;
import com.kehutong.department.service.ThridEmployeeService;
import org.coraframework.logger.Logger;
import org.coraframework.logger.LoggerFactory;
import org.coraframework.util.Ioc;

/**
 * TODO
 *
 * @author kht0601
 * @version 1.0
 * @date 2021/9/9 11:15
 */
public class ThirdEmployeeJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(ThirdEmployeeJob.class);

    private ThridEmployeeService thridEmployeeService;


    public ThridEmployeeService getThridEmployeeService() {
        return thridEmployeeService;
    }

    public void setThridEmployeeService(ThridEmployeeService thridEmployeeService) {
        this.thridEmployeeService = thridEmployeeService;
    }

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            logger.info("执行第三方员工同步定时任务开始！");
            thridEmployeeService.employTask();
        } catch (Exception e) {
            logger.error("执行第三方员工同步定时任务出现异常！{}", e);
        }
    }
}
